home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 July
/
EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso
/
earcd
/
biz
/
misc
/
alarmst_.lha
/
test
/
Alarmist_OnTimeEdit.rexx
next >
Wrap
OS/2 REXX Batch file
|
1997-04-05
|
3KB
|
108 lines
/*******************************************************************
* ARexx Script: Alarmist_OnTimeEdit.rexx *
* Version.....: 1.00 (14.02.97) *
* ---------------------------------------------------------------- *
* This script is called by Alarmist when you double-click on an *
* entry in either the Reminder or Today's Task List. This script *
* will run On-Time (if it isn't already running) and tell it to *
* search for the relevent item and bring up an edit window for it. *
* If you call it manually then it will try and find the current *
* Alarm activated in the main list. *
*******************************************************************/
/* We expect the Item Type followed by the Item Name as arguments */
/* Item Types: 1 = Event, 2 = Task */
/* If we receive nothing then we'll try and use an active entry */
/* in the Alarmist main list. */
options results
parse arg type name
/* Was the script called without an Even name parameter? */
if (name = '') then
do
/* Let's see if we have an active entry */
getactive
if (result = 0) then
exit(10)
/* Get the data we need, ie. name */
getfield 1
name = result
getfield 2
source = result
/* Just make sure this it isn't an Alarmist Event. */
if (source = 1) then
do
'requester button Oops message "'name'" is an Alarmist Event!'
exit(10)
end
type = 1 /* An Event of course */
if (name = '') then
exit(10)
end
/* If On-Time isn't running then call it */
if (~show('p', "ONTIME")) then
do
address command
/* Get On-Time running */
'echo >pipe:temp stack 9000'
'echo >pipe:temp everyday:ontime'
'copy pipe:temp t:temp.scr'
'run >NIL: execute t:temp.scr'
DO WHILE ~show('p', "ONTIME")
END
if (rc ~= 0) then
do
say 'The program "Everyday:OnTime" failed or was not located.'
exit(5)
end
address rexx
end
address ONTIME
/* Before searching, we have to turn the relevant filter off so all list items
are shown. This is because the search function only searches items displayed
in the current list. We also have to make sure no item is active because the
search function starts from after the currently active entry. */
if (type = 1) then
do
'active event noactive'
'filter event state 0'
'search event casesens field 1 'name
end
else
do
'active task noactive'
'filter task 0'
'search task casesens field 1 'name
end
if (rc ~= 0) then
do
'requester button #:~( message Can''t find "'name'"'
exit (10)
end
if (type = 1) then
edit event
else
edit task
/* Our work is done */
/* End */